﻿namespace Webinator.Interfaces
{
    using System.Collections.Generic;
    using System.Diagnostics.CodeAnalysis;
    using System.Drawing;
    using Enums;
    using Impls;

    [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented", Justification = "Reviewed. Suppression is OK here.")]
    public interface ICore
    {
        Config Config { get; set; }

        void AddCookie(string name, string value, string path, string domain);

        void CloseBrowser();

        void ConfirmDialog();

        void DeleteCookie(string name);

        void DismissDialog();

        bool DialogPresent();

        void ElementClear(object element);

        void ElementClick(object element);

        void ElementFocus(object element);

        bool ElementIsChecked(object element);

        bool ElementIsDisplayed(object element);

        void ElementSelect(object element);

        void ElementSendkeys(object element, string text);

        void ElementTriggerEvent(object element, EventIs eventIs);

        object EvaluateScript(string js);

        void ExecuteScript(string js);

        object FindElement(Locator locator, int timeout = 20000);

        object FindElements(Locator locator);

        string GetAttribute(object element, string attribute);

        object GetCore();

        string GetElementText(object element);

        Rectangle GetLocatorLocation(Locator locator);

        IEnumerable<Rectangle> GetLocatorLocations(Locator locator);

        string GetPageSource();

        string GetPageTitle();

        string GetPageUrl();

        SelectedItem GetSelectedItem(Locator locator);

        IEnumerable<SelectedItem> GetSelectedItems(Locator locator);

        string GetVisibleText();

        void NavigateBack();

        void NavigateForward();

        void NavigateRefresh();

        void NavigateToUrl(string url);

        bool QuickElementExists(Locator locator);

        bool QuickWaitElementDoesntExist(Locator locator, int waitInMilliseconds);

        bool QuickWaitElementExists(Locator locator, int waitInMilliseconds);

        void SelectListItems(Locator locator, Selector[] selectors);

        void SetAttribute(object element, string attribute, string value);

        void UpdateCore(object driver);

        bool WaitElementAppear(Locator locator, int waitInMilliseconds, int index);

        bool WaitElementDisappear(Locator locator, int waitInMilliseconds, int index);

        void SwitchWindow(SwitchBy switchBy, Comparison comparison, string argument);

        void SwitchToMainWindow();

        void SwitchToMainFrame();

        void SwitchToFrame(Locator locator);

        bool CurrentWindowIsValid();

        void CloseWindow();

        IEnumerable<string> WindowTitles();

        IEnumerable<string> WindowUrls();
    }
}